package com.qzdsoft.erpcloud.service.pu;

import java.util.List;

import com.qzdsoft.erpcloud.domain.pu.PurchaseApply;
import com.qzdsoft.erpcloud.vo.pu.PurchaseApplyDetailInfo;
import com.qzdsoft.erpcloud.vo.pu.PurchaseApplyDetailQueryInfo;
import com.qzdsoft.erpcloud.vo.pu.PurchaseApplyInfo;
import com.qzdsoft.vo.LayTableResponse;
import com.qzdsoft.vo.Response;
import com.qzdsoft.vo.TypeInfo;
/**
 * 采购申请单
 * <p>detailed comment
 * @author ZhangHao Sep 30, 2017
 * @see
 * @since 1.0
 */
public interface PurchaseApplyService {

	/**
	 * 获取请购单首页数据（表头）
	 * @param rows
	 * @param page
	 * @return
	 */
    LayTableResponse<PurchaseApplyInfo> getHeaderData(int page, int limit);
    
    /**
     * 新增表头保存
     * @param apply
     * @return
     * @throws Exception 
     */
    Response<String> add(PurchaseApply apply) throws Exception;
    /**
     * 查询一条记录
     * @param companyid
     * @param id
     * @return
     * @throws Exception
     */
    PurchaseApplyInfo findById(int companyid, Integer id) throws Exception;
    /**
     * 编辑保存
     * @param apply
     * @return
     * @throws Exception
     */
    Response<String> edit(PurchaseApply apply) throws Exception;
    /**
     * 删除单据
     * @param apply
     * @return
     */
    Response<String> headerdel(PurchaseApply apply);
    /**
     * 单据审核
     * @param id
     * @return
     */
    Response<String> review(Integer id);
    /**
     * 单据弃审
     * @param id
     * @return
     */
    Response<String> cancleReview(Integer id);
    
    /**
     * 查询请购单编号和id
     */
    List<TypeInfo> queryBillNo(Integer companyid);
    
    /**
     * 加载明细页面详情
     * @param queryinfo
     * @return
     */
    List<PurchaseApplyDetailInfo> selectDetailByBillId(
            PurchaseApplyDetailQueryInfo queryinfo);
}
